package com.xxh.blog.model;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Data
@Document(indexName = "essay",createIndex = true)
public class EssayDocument implements Serializable {

    private Long id;

    @Field(type = FieldType.Text,searchAnalyzer = "ik_smart",analyzer = "ik_max_word")
    private String title;

    @Field(type = FieldType.Long)
    private Long userId;


    @Field(type = FieldType.Keyword)
    private String authorName;
    private String authorIcon;
    private Long categoryId;

    @Field(type = FieldType.Keyword)
    private String categoryName;

    @Field(type = FieldType.Date)
    private Date created;

    private Boolean recommend;
    private Integer commentCount;
    private Integer viewCount;
    private Integer level;
}
